/*
 * Copyright © Yan Zhenjie
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.qhzz.permissionlib;

import android.support.annotation.NonNull;

/**
 * <p>Permission request.</p>
 */
public interface Request {

    /**
     * Here to fill in all of this to apply for permission, can be a, can be more.
     *
     * @param permissions one or more permissions.
     * @return {@link Request}.
     */
    @NonNull
    Request permission(String... permissions);

    /**
     * Here to fill in all of this to apply for permission, can be a, can be more.
     *
     * @param permissionsArray one or more permissions.
     * @return {@link Request}.
     */
    @NonNull
    Request permission(String[]... permissionsArray);

    /**
     * 当用户曾拒绝过后调用  用默认值
     */
    Request setRationaleListener(PermissionActivity.RationaleListener listener);

    @NonNull
    Request setOnGrantListener(OnGrantListener grantListener);

    Request setOnRefuseListener(OnRefuseListener refuseListener);

    Request setRequestCode(int requestCode);
    /**
     * 请求权限
     */
    void start();

}
